package com.example.demo;

import com.example.demo.generator.config.CodeGeneratorProperties;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author Atanycosts
 */
@Slf4j
@SpringBootApplication
@EnableScheduling
@EnableConfigurationProperties(CodeGeneratorProperties.class)
public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
        log.info("FISCO BCOS 通用模板已启动，可以开始接入业务模块");
        log.info("当前模板仅保留基础组件，请根据实际需求扩展控制器与服务层");
    }

    @Configuration
    @ConditionalOnProperty(name = "feature.database.enabled", havingValue = "true")
    @MapperScan("com.example.demo.**.mapper")
    static class DatabaseConfiguration {
    }
}
